﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using IHISCETeim.BLL;
using IHISCETeim.Library;
using IHISCETeim.Model;
using System.Data;

namespace IHISCETeim.Web.MachineSys.FXModel
{
    public partial class ReportAreaManagerGetRZZRBD : PageBase
    {
        protected override Permission[] PowerKey
        {
            get
            {
                return new Permission[] { Permission.查看 };
            }
        }
        protected override string DWZRef
        {
            get
            {
                return "ReportAreaManagerGetRZZRBD";
            }
        }
        #region 属性 (查询条件)




        #endregion
        protected DataTable sumdt = new DataTable();
        protected void Page_Load(object sender, EventArgs e)
        {
            string agentsqltemp = SAreaManagerAgentController.GetMyAgentSqlWhere();


            string wheresql = string.Format(" AliasName in ({0})", agentsqltemp);

            DataTableCollection dts = FXFinanceLeaseController.ReportGetRZZRBD(wheresql);
            sumdt = dts[1];
            this.rpMenu.DataSource = dts[0];
            this.rpMenu.DataBind();

            AddLog(Permission.查看);
        }
        protected object GetSUMDT(string FiledName)
        {
            if (sumdt == null)
                return "0";
            try
            {
                return GetMoneyFormart(sumdt.Rows[0][FiledName]);
            }
            catch
            {
                return "0";
            }
        }


        protected object GetSUMDT2(string FiledName)
        {
            if (sumdt == null)
                return "0";
            try
            {
                //return GetMoneyFormart(sumdt.Rows[0][FiledName]);
                return FormatDecimalToStrings(sumdt.Rows[0][FiledName], "N");
            }
            catch
            {
                return "0";
            }
        }

        protected object GetMoneyFormart(object money)
        {
            return FormatDecimalToStrings(money, "G");
        }
    }
}